package com.mine.modules.vm.controller;


import com.mine.common.domain.vo.Result;
import com.mine.modules.vm.domain.query.LayerQuery;
import com.mine.modules.vm.service.IVmSensorService;
import com.mine.modules.vm.service.IVmSensorTreeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 传感器分类 前端控制器
 * </p>
 *
 * @author xujf
 * @since 2024-11-08
 */
@Api(tags = "传感器分类树")
@RestController
@RequestMapping("/vm/sensor/tree")
@RequiredArgsConstructor
public class VmSensorTreeController {

    private final IVmSensorTreeService vmSensorTreeService;

    private final IVmSensorService vmSensorService;

    @ApiOperation("图层树形列表")
    @RequestMapping(value = "/listAll", method = RequestMethod.GET)
    public Result<?> listAll(String keywords) {
        return vmSensorTreeService.listAll(keywords);
    }

    @ApiOperation("手动同步")
    @RequestMapping(value = "/synSensors", method = RequestMethod.GET)
    public Result<?> synSensors() {
        vmSensorService.synSensors();
        return Result.OK("同步成功！");
    }
}
